package com.ashley.apptools.utils;

import java.util.ArrayList;

import com.ashley.apptools.vo.ItemVo;

public class PriceCount {
	public static final float freightCount(float cubes,float cubeBy)
	{
		
		return cubes*cubeBy;
	}
	public static final float taxCount(float fobPrice,float tax)
	{
		return fobPrice * (tax / 100);
		
	}
	public static final float landingPriceCount(float fobPrice, float freight, float taxCount)
	{
		return fobPrice+freight+taxCount;
		
	}
	public static final float landingProfitCount(float landing, float landingPrice)
	{
		return landingPrice+landingPrice * (landing / 100);
		
	}
	public static final float warehovseProfitCount(float landingCount, float warehovse)
	{
		return landingCount+landingCount * (warehovse /100);
		
	}
	public static final float saleProfitCount(float warehovseCount, float sale)
	{
		return warehovseCount+warehovseCount * (sale / 100);
		
	}
	public static final double retailPrice(double saleCount)
	{
		return Math.round(saleCount/0.01)*0.01;
		
	}
	public static final double overallProfit(double retailPrice, float landingPrice)
	{
		return Math.round((retailPrice - landingPrice) / retailPrice/0.01)*0.01;
	}
	public static final double retailGroupPrice(ArrayList<ItemVo> arrayList)
	{
		ItemVo itemVo = null;
		double price = 0;
		for (int i = 0; i < arrayList.size(); i++) {
			itemVo = arrayList.get(i);
			price += itemVo.getRetail();
		}
		return price;
	}
	public static final String getItemName(ArrayList<ItemVo> arrayList)
	{
		ItemVo vo = null;
		String name = "itemNo: \n";
		for (int i = 0; i < arrayList.size(); i++) {
			vo = arrayList.get(i);
			
			name +=" "+vo.getItemNo() +"	"; 
		}
		return name;
		
	}
}
